$p_kbn = $_GET["kbn"];
$p_code = $_GET["code"];
$p_houmen = $_GET["houmen"];
require("const.inc");
require("func.inc");
require("dbconnect.inc");
if($p_kbn == 0){
$dsp_hyomei = "平日時刻表";
$css_jikan = "ro3";
$css_title = "ro5";
}else{
$dsp_hyomei = "休日時刻表";
$css_jikan = "ro4";
$css_title = "ro6";
}
$dbSession = new _DbConnect;
//行先・経由検索
$sql = "select b.名称, c.路線コード, c.注意書き, c.経由 ";
$sql = $sql . "from 名称M b, 路線M c " ;
$sql = $sql . "where b.名称区分 = '04' ";
$sql = $sql . "and c.停留所 = '$p_code' ";
$sql = $sql . "and c.方面 = '$p_houmen' ";
$sql = $sql . "and c.行先 = b.名称コード ";
$sql = $sql . "order by b.名称,c.経由";
$sql = mb_convert_encoding($sql, "EUC-JP", "auto");
$result=pg_exec($sql);
$rows=pg_numrows($result);
$wrosen = "";
$w_ikisaki = "";
$p = -1;
for($j = 0; $j < $rows; $j++){
$ikisaki_nm = mb_convert_encoding(mb_convert_encoding(pg_result($result,$j,0),"sjis-win","EUC-JP"),"UTF-8","sjis-win");
$rosen = mb_convert_encoding(mb_convert_encoding(pg_result($result,$j,1),"sjis-win","EUC-JP"),"UTF-8","sjis-win"); // 時刻表示時に使用
$tyui = mb_convert_encoding(mb_convert_encoding(pg_result($result,$j,2),"sjis-win","EUC-JP"),"UTF-8","sjis-win");
$keiyu_cd = mb_convert_encoding(mb_convert_encoding(pg_result($result,$j,3),"sjis-win","EUC-JP"),"UTF-8","sjis-win");
//print($ikisaki_nm . "
");
//print($rosen . "
");
//print($tyui . "
");
//print($keiyu_cd . "
");
//経由名
$sql = "select b.名称 ";
$sql = $sql . "from 名称M b " ;
$sql = $sql . "where b.名称区分 = '03' ";
$sql = $sql . "and b.名称コード = '$keiyu_cd' ";
$sql = mb_convert_encoding($sql, "EUC-JP", "auto");
$result2=pg_exec($sql);
if ($result2 == false) {
print("SQLの実行に失敗しました");
exit;
}
$rows2 = pg_numrows($result2);
if($rows2 != 0){
$keiyu_nm = mb_convert_encoding(mb_convert_encoding(pg_result($result2,0,0),"sjis-win","EUC-JP"),"UTF-8","sjis-win");
}else{
$keiyu_nm = "";
}
$rosen_nm = $ikisaki_nm . $keiyu_nm;
//print($keiyu_nm . "
");
//print($rosen_nm . "
");
if($w_ikisaki != $rosen_nm){
$w_ikisaki = $rosen_nm;
$p = $p + 1;
}
$rosen_gun[$p] = $rosen_gun[$p] . "|" . $rosen;
$keiyu_gun[$p] = $keiyu_nm;
$ikisaki_gun[$p] = $ikisaki_nm;
$tyui_gun[$p] = $tyui;
if( $wrosen == "" ){
$wrosen = "'" . $rosen . "'";
}else{
$wrosen = $wrosen . ",'" . $rosen . "'";
}
}
$column_count = $p + 1;
?>
(旧)路線バス時刻表 - ページを印刷する | 富山地方鉄道株式会社
|
停車(経由) / 時刻 |
//行先表示
for($i = 0; $i < $column_count; $i++){
?>
( 経由)}?> |
}
if( $rows <> 0 ){
// 時刻データ
$sql = "select 路線コード, 時刻, 休日区分, フラグ ";
$sql = $sql . "from 時刻D " ;
$sql = $sql . "where 路線コード IN ( $wrosen) ";
$sql = $sql . "and 休日区分 = '$p_kbn' ";
$sql = $sql . "order by 休日区分, 時刻, 路線コード ";
$sql = mb_convert_encoding($sql, "EUC-JP", "auto");
//print($sql);
$result3=pg_exec($sql);
if ($result3 == false) {
print("SQLの実行に失敗しました");
print($sql);
exit;
}
// 変数初期化
$rows3=pg_numrows($result3);
for($j = 0; $j < $column_count; $j++){
$whsel[6][$j] == ""; $whsel[7][$j] == "";
$whsel[8][$j] == ""; $whsel[9][$j] == "";
$whsel[10][$j] == ""; $whsel[11][$j] == "";
$whsel[12][$j] == ""; $whsel[13][$j] == "";
$whsel[14][$j] == ""; $whsel[15][$j] == "";
$whsel[16][$j] == ""; $whsel[17][$j] == "";
$whsel[18][$j] == ""; $whsel[19][$j] == "";
$whsel[20][$j] == ""; $whsel[21][$j] == "";
$whsel[22][$j] == ""; $whsel[23][$j] == "";
$whsel[24][$j] == "";
}
$cnt = 0;
$j = 0;
$wrosencd = "";
for($k = 0; $k < $rows3; $k++){
$rosencd = pg_result($result3,$k,0);
// 路線コードがブレイク
if( $rosencd <> $wrosencd ){
for($n = 0; $n < $column_count; $n++){
$ww_rosen = explode("|", $rosen_gun[$n]);
for($o = 1; $o < sizeof($ww_rosen); $o++){
//print("$ww_rosen[$o] : $rosencd ");
if( $ww_rosen[$o] !="" && $ww_rosen[$o] == $rosencd ){
//print("一致 $ww_rosen[$o] : $rosencd ");
//$code_str = $rosencd;
$j = $n;
break 2;
}
}
}
$wrosencd = $rosencd;
}
$whourkoku = pg_result($result3,$k,1);
$kbn = pg_result($result3,$k,2);
$flg = pg_result($result3,$k,3);
$whour = substr($whourkoku,0, 2);
// $wmin = substr($whourkoku,2, 2) . "|" . $j . "|" . $code_str . "aaa" . $rosencd;
$wmin = substr($whourkoku,2, 2);
// フラグ名称
$frg_nm = "";
if ($flg <> ""){
$sql = "SELECT a.名称 ";
$sql = $sql . "FROM 名称M a ";
$sql = $sql . "WHERE a.名称区分 = '05' ";
$sql = $sql . "AND a.名称コード = '$flg' ";
$sql = mb_convert_encoding($sql, "EUC-JP", "auto");
$result4=pg_exec($sql);
if ($result4 == false) {
print("SQLの実行に失敗しました");
exit;
}
$rows4=pg_numrows($result4);
if($rows4 != 0){
$frg_nm = mb_convert_encoding(mb_convert_encoding(pg_result($result4, 0 ,0),"sjis-win","EUC-JP"),"UTF-8","sjis-win");
}
pg_freeresult($result4);
}
//
$id = "";
if($frg_nm == "★"){
$id = "sp";
}
if($frg_nm == "☆"){
$id = "sp2";
}
if($frg_nm == "▽"){
$id = "sp3";
}
if($frg_nm == "$"){
$id = "sp4";
}
if($frg_nm == "&"){
$id = "sp5";
}
if($frg_nm == "※"){
$id = "sp6";
}
if($frg_nm == "○"){
$id = "sp7";
}
if($frg_nm == "◇"){
$id = "sp8";
}
if($frg_nm == "△"){
$id = "sp9";
}
if($frg_nm == "□"){
$id = "sp10";
}
if($frg_nm == "◎"){
$id = "sp11";
}
$dset_x = $frg_nm . $wmin;
// $dset_x = $wmin;
// $dset = "$dset_x";
$dset = $dset_x;
if( $whour == "06" ){
if( $whsel[6][$j] == "" ){
$whsel[6][$j] = $dset;
}else{
$whsel[6][$j] = $whsel[6][$j] . " " . $dset;
}
}else if( $whour == "07" ){
if( $whsel[7][$j] == "" ){
$whsel[7][$j] = $dset;
}else{
$whsel[7][$j] = $whsel[7][$j] . " " . $dset;
}
}else if( $whour == "08" ){
if( $whsel[8][$j] == "" ){
$whsel[8][$j] = $dset;
}else{
$whsel[8][$j] = $whsel[8][$j] . " " . $dset;
}
}else if( $whour == "09" ){
if( $whsel[9][$j] == "" ){
$whsel[9][$j] = $dset;
}else{
$whsel[9][$j] = $whsel[9][$j] . " " . $dset;
}
}else if( $whour == "10" ){
if( $whsel[10][$j] == "" ){
$whsel[10][$j] = $dset;
}else{
$whsel[10][$j] = $whsel[10][$j] . " " . $dset;
}
}else if( $whour == "11" ){
if( $whsel[11][$j] == "" ){
$whsel[11][$j] = $dset;
}else{
$whsel[11][$j] = $whsel[11][$j] . " " . $dset;
}
}else if( $whour == "12" ){
if( $whsel[12][$j] == "" ){
$whsel[12][$j] = $dset;
}else{
$whsel[12][$j] = $whsel[12][$j] . " " . $dset;
}
}else if( $whour == "13" ){
if( $whsel[13][$j] == "" ){
$whsel[13][$j] = $dset;
}else{
$whsel[13][$j] = $whsel[13][$j] . " " . $dset;
}
}else if( $whour == "14" ){
if( $whsel[14][$j] == "" ){
$whsel[14][$j] = $dset;
}else{
$whsel[14][$j] = $whsel[14][$j] . " " . $dset;
}
}else if( $whour == "15" ){
if( $whsel[15][$j] == "" ){
$whsel[15][$j] = $dset;
}else{
$whsel[15][$j] = $whsel[15][$j] . " " . $dset;
}
}else if( $whour == "16" ){
if( $whsel[16][$j] == "" ){
$whsel[16][$j] = $dset;
}else{
$whsel[16][$j] = $whsel[16][$j] . " " . $dset;
}
}else if( $whour == "17" ){
if( $whsel[17][$j] == "" ){
$whsel[17][$j] = $dset;
}else{
$whsel[17][$j] = $whsel[17][$j] . " " . $dset;
}
}else if( $whour == "18" ){
if( $whsel[18][$j] == "" ){
$whsel[18][$j] = $dset;
}else{
$whsel[18][$j] = $whsel[18][$j] . " " . $dset;
}
}else if( $whour == "19" ){
if( $whsel[19][$j] == "" ){
$whsel[19][$j] = $dset;
}else{
$whsel[19][$j] = $whsel[19][$j] . " " . $dset;
}
}else if( $whour == "20" ){
if( $whsel[20][$j] == "" ){
$whsel[20][$j] = $dset;
}else{
$whsel[20][$j] = $whsel[20][$j] . " " . $dset;
}
}else if( $whour == "21" ){
if( $whsel[21][$j] == "" ){
$whsel[21][$j] = $dset;
}else{
$whsel[21][$j] = $whsel[21][$j] . " " . $dset;
}
}else if( $whour == "22" ){
if( $whsel[22][$j] == "" ){
$whsel[22][$j] = $dset;
}else{
$whsel[22][$j] = $whsel[22][$j] . " " . $dset;
}
}else if( $whour == "23" ){
if( $whsel[23][$j] == "" ){
$whsel[23][$j] = $dset;
}else{
$whsel[23][$j] = $whsel[23][$j] . " " . $dset;
}
}else if( $whour == "24" ){
if( $whsel[24][$j] == "" ){
$whsel[24][$j] = $dset;
}else{
$whsel[24][$j] = $whsel[24][$j] . " " . $dset;
}
}
// 路線コード退避
$wrosencd = $rosencd;
}
}
?>
|
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
for($i = 0; $i < $column_count; $i++){
?>
for($j = 6; $j < 25; $j++){
?>
|
}
?>
}
?>
閉じる
経路案内
始発情報
|
: |
06:36発 豊田本町1丁目 |
系統番号
|
: |
62 |